/**
 * Created by yyj on 2015/10/28.
 */
$(function(obj){

    //点击关闭按钮
    $('.press_btn2.Close').click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
        parent.$('.checkAll').removeAttr('checked');
    })
    //点击修改按钮
     $('.press_btn1.Keep').click(function(){
     	var roleId=$("#roleId").val();
     	parent.$('.checkAll').removeAttr('checked');
     	window.location.href="initEditSysRolePrivilege.do?roleId="+roleId;
    })
    
    
    
    
var setting = {
    data: {
        key: {
            url:"u"
        },
        simpleData: {
            enable: true
        }
    },
    callback: {
        onClick:onClick
    }
};

	var roleId=$("#roleId").val();
	


	$.ajax({
		type: 'POST',
		dataType : "json",
		data:{
        		"roleId":roleId
            },
		url: "initLookPrivilege.do",//请求的action路径
		error: function () {//请求失败处理函数
			layer.msg('请求失败！！',{time:2000});
		},
		success:function(result){ //请求成功后处理函数。  
			var treeNodes = eval("("+result.lstTree+")");//把后台封装好的简单Json格式赋给treeNodes
			if(treeNodes == ""){
				document.getElementById("isNull").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;未分配任何权限！";
			}
			$.fn.zTree.init($("#treeWay"), setting, treeNodes); 
		}
	});
	
	
    
});

function onClick(event, treeId, treeNode, clickFlag) {
    
}



